﻿Imports System.Threading
Imports System.Globalization

Partial Public Class Site1
    Inherits System.Web.UI.MasterPage
    Private db As New hc_databaseDataContext

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Thread.CurrentThread.CurrentCulture = New CultureInfo("de-DE")

        If Session.IsNewSession Then
            Session("url") = Request.QueryString

            'Try
            '    Session("url") = Request.QueryString
            '    Dim usertest As Mitgliede_Anwaerter = Session("userid")
            '    Response.Write(usertest.Benutzername)
            'Catch ex As Exception
            '    Response.Redirect("login.aspx")

            'End Try

            Response.Redirect("login.aspx")

        End If
        Label1.Text = Session("username")
        If Session("Rang") = "Vorstand" Then
            admin.Visible = True


        End If
    End Sub

    Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LinkButton1.Click
        Session.Abandon()
        Response.Redirect("Login.aspx")

    End Sub
End Class